package com.xiaowan.user.controller;


import com.xiaowan.config.AppConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestMethod {

    /**
     * @Description 模拟好spring环境,直接测试service
     * @Author wbm
     * @return void
     **/
    public static void main(String[] args) {
        AnnotationConfigApplicationContext springContainer = new AnnotationConfigApplicationContext();
        springContainer.register(AppConfig.class);
        springContainer.refresh();


        // 可以测试service里面的方法
//        UserService userService = (UserService) springContainer.getBean("userServiceImpl");
//        String result = userService.testMapperXmlQuery();
//        System.out.println(result);
        // 测试事务
//        userService.testTransactional();

    }
}
